// 所有需要全局注册的组件入口
import Icon from './icon/'
import Title from './title/'
import Button from './button/'
import Card from './card/'
import Divider from './divider/'
import {Tabs, TabPane} from './tabs/'
import {Row, Col} from './grid/'
import {Layout, Header, Footer, Content, Sider} from './layout/'
import {Collapse, CollapseItem} from './collapse/'
import List from './list/'
import {Menu, MenuGroup, MenuItem, Submenu} from './menu/'
// import {Dropdown, DropdownItem, DropdownMenu} from './dropdown/'
import {Dropdown, DropdownItem, DropdownMenu} from './dropdown2/'
import Pagination from './pagination/'
import Steps from './steps/'
import Breadcrumb from './breadcrumb/'
import {Form, FormItem} from './form/'
import Input from './input/'
import Switch from './switch/'
import {Radio, RadioGroup} from './radio/'
import {Checkbox, CheckboxGroup} from './checkbox/'
import Select from './select/'
import Cascader from './cascader/'
import InputNumber from './inputNumber/'
import {Upload, ImgCrop} from './upload/'
import {Table, TableColumn} from './table/'
import Transfer from './transfer/'
import Tree from './tree/'
import {Datepicker} from './datepicker/'
import ColorPicker from "./colorpicker/colorpicker"
import Slider from './slider/'
import Alert from './alert/'
import {Notification, notify} from './notification/'
import {Dialog, DialogAlert} from './dialog/'
import Drawer from './drawer/'
import Tooltip from './tooltip/'
import {Timeline, TimelineItem} from './timeline/'
import {Carousel, CarouselItem} from './carousel/'
import Progress from './progress/'
import Tag from './tag/'
import Badge from './badge/'
import Avatar from './avatar/'
import Loading from './loading/'
import Empty from './empty/'
import Result from './result/'
import Exception from './exception/'
import Autocomplete from './autocomplete/'
import BackTop from './backTop/'
import Affix from './affix/'
import LoadingBar from './loadingBar/index'
import Anchor from './anchor/index'
import Image from './image/index'
import Message from './message/'
import TreeSelect from './treeSelect/'
import {menuItem, navMenu, submenu} from './vabMenu/'
import VXETable from './vxeTable/'
import descriptions from './descriptions/'
import descriptionsItem from './descriptions-item/'



// 载入需要的样式文件，一起打包
import '../assets/css/common.css'
import '../assets/font/iconfont.css'

const component = [
	Icon,
	Title,
	Button,
	Card,
	Divider,
	Tabs, TabPane,
	Row, Col,
	Layout, Header, Footer, Content, Sider,
	Collapse, CollapseItem,
	List,
	Menu, MenuItem, MenuGroup, Submenu,
	menuItem, navMenu, submenu,
	Dropdown, DropdownItem, DropdownMenu,
	//DropdownOther, DropdownItemOther, DropdownMenuOther,
	Pagination,
	Steps,
	Breadcrumb,
	Form, FormItem,
	Input,
	Switch,
	Radio, RadioGroup,
	Checkbox, CheckboxGroup,
	Select,
	Cascader,
	InputNumber,
	Upload, ImgCrop,
	Table, TableColumn,
	Transfer,
	Tree,
	Datepicker,
	ColorPicker,
	Slider,
	Alert,
	Notification,
	Dialog, 
	Drawer,
	Tooltip,
	Timeline, TimelineItem,
	Carousel, CarouselItem,
	Progress,
	Tag,
	Badge,
	Avatar,
	Empty,
	Result,
	Exception,
	Autocomplete,
	BackTop,
	Affix,
	LoadingBar,
    Anchor,
	Image,
	TreeSelect,
	descriptions,
	descriptionsItem
]

const install = function (Vue) {
	component.forEach(item => {
		Vue.component(item.name, item)
	})

	Vue.prototype.$dialog = DialogAlert.Dialog
	Vue.prototype.$dialogClear = DialogAlert.Clear
	Vue.prototype.$alert = DialogAlert.Alert
	Vue.prototype.$msg = DialogAlert.Msg
	Vue.prototype.$notify = notify
  	Vue.prototype.$loading = Loading
	Vue.prototype.$LoadingBar = LoadingBar;
	Vue.prototype.$message = Message
  	Vue.use(Loading.directive)
	Vue.use(VXETable)
}

export default install

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}